<#assign menu="system">
<#assign submenu="admin_list">
<#include "/system/head.ftl">
<style type="text/css">
.pagination {
    border-radius: 4px;
    display: inline-block;
    margin: 0;
    padding-left: 0;
}
</style>
	<!--main content start-->
	<section id="main-content">
		<section class="wrapper">
        	<!-- page start-->
            <section class="panel">
            	<header class="panel-heading">
               		 所有管理员列表
                </header>
                <div class="panel-body">
                	<div class="adv-table">
                    	<div role="grid" class="dataTables_wrapper" id="hidden-table-info_wrapper">
                            <table class="table table-striped table-advance table-hover">
                            	<thead>
                                	<tr>
                						<th>管理员名称</th>
                						<th>电子邮箱</th>
                						<th>状态</th>
                						<th>时间</th>
                						<th>操作</th>
              						</tr>
                                </thead>
                            	<tbody role="alert" aria-live="polite" aria-relevant="all">
                            		<#list pageVo.list as e>
                            		<tr class="gradeA odd">
                                    	<td>${e.name}</td>
                                    	<td>${e.email}</td>
                                    	<td>${e.status}</td>
                                    	<td>${e.createTime?string("yyyy-MM-dd HH:mm:ss")}</td>
                                    	<td>
                  							<!-- Icons -->
                  							<a href="${basePath}/admin/admin/update.htm?adminId=${e.adminId}" title="修改">
	                  							<button class="btn btn-primary btn-xs">
		        									<i class="icon-pencil"></i>
		        								</button>
	              							</a>
                							<a href="javaScript:deleteById(${e.adminId});" title="删除">
                  								<button class="btn btn-danger btn-xs">
                  									<i class="icon-trash "></i>
                  								</button>
                  							</a>
                						</td>
                                	</tr>
                                	</#list>
                               	</tbody>
                              </table>
                              <div style="height: 30px;">
                             	<div class="pagination">${pageVo.pageNumHtml}</div>
                              </div>
                           </div>
                        </div>
                  </div>
              </section>
              <!-- page end-->
          </section>
		</section>
		<!--main content end-->
<script type="text/javascript">
function deleteById(id){
	var url="${basePath}/admin/admin/delete.json";
	bootbox.dialog({
		message : "是否删除",
		title : "提示",
		buttons : {
			"delete" : {
				label : "确定",
				className : "btn-success",
				callback : function() {
					/*$.get(url, { "adminId": id},function(data){
						if (data.result) {
							bootbox.alert("保存成功，将刷新页面", function() {
								window.location.reload();
							});
						}else{
							showErrors($('#add_admin_form'),data.errors);
						}
					}, "json");*/
				$.ajax( {  
			        type : 'GET',  
			        //contentType : 'application/json',     
			        url : url,
			        data:{ "adminId": id},
			        async: false,//禁止ajax的异步操作，使之顺序执行。  
			        dataType : 'json',  
			        success : function(data,textStatus){  
			        	if (data.result) {
							bootbox.alert("保存成功，将刷新页面", function() {
								window.location.reload();
							});
						}else{
							bootbox.alert(data.errors);
						}
			        },  
			        error : function(data,textstatus){
				        bootbox.alert({  
				            buttons: {  
				               ok: {  
				                    label: '关闭'
				               }  
				            },  
				            message: data.responseText,
				            title: '<@spring.message "system.errorTip"/>',  
				        });
			        }  
			    }); 
				}
			},
			"cancel" : {
				label : "取消",
				className : "btn-primary",
				callback : function() {
				
				}
			}
		}
	});	
}
</script>
<#include "/system/foot.ftl">
